package com.my.java.concurrent.blocking_quere.delay_queue;

import java.util.concurrent.DelayQueue;

class Teacher implements Runnable {

        private DelayQueue<Student> students;

        public Teacher(DelayQueue<Student> students) {
                this.students = students;
        }

        @Override
        public void run() {
                try {
                        System.out.println(" test start");
                        while (!Thread.interrupted()) {
                                students.take().run();
                        }
                }
                catch (Exception e) {
                        e.printStackTrace();
                }
        }

}